{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CART与决策树的超参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import datasets\n",
    "X, y = datasets.make_moons(noise=0.25, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xf95c7a0cc8>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD6CAYAAACiefy7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAc+0lEQVR4nO3dfaxdVZkG8OehVLh+pAV6lXLbWpgwqGBJ5QaETgxSkQ8tVEAE/xhIJA3jEGeYhMwlJrUhmVBsMoyMzpj6ETEZkYpa61BTPwphQoThlra0BQsVNdy2IxWmdYgN9uOdP84+7bnn7nPO/lx77b2eX0J67zmbs9fd99z3rP2ud61FM4OIiDTfCVU3QERE3FDAFxEJhAK+iEggFPBFRAKhgC8iEggFfBGRQBQS8El+k+SrJLf3eP5SkgdIbon+W17EeUVEJLkTC3qdbwH4MoBv9znmv8zs40lfcNasWTZ//vyczRIRCcumTZv+YGbDcc8VEvDN7AmS84t4rbb58+djfHy8yJcUEWk8kr/r9ZzLHP7FJLeS/AnJc+MOILmM5DjJ8X379jlsmohI87kK+M8CeLeZnQ/gXwGsjTvIzFab2aiZjQ4Px96RiIhIRk4Cvpn90czeiL5eD2A6yVkuzi0iIi1OAj7J00ky+vrC6LyvuTi3iIi0FDJoS/IhAJcCmEVyAsAXAEwH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JG9H627kstJbllyV1y+JZ9Fa7+UNklcDWAvg7CoaQvLtAL4P4O/N7I/dT8f8L06v44D2pb6OlQZ8y799Iqy19j7M7FWSP0TrlryQgF9A+0rf3rFfG0n+nuRsM9sb3Yq+2uM12tfwZZKPo9WbKCvgJ7km7WMmSJ4IYAbcpQgGts/MXuv49msA7nPQrjS83la0M3CZ2XqS/0Zylpk5XbCM5HS0gul/mNkPYg6p9DoOal+W61jrlA7Jt5F8R/trAB8FEFsZUJGqt3dcB+CW6OtbAEy5KyF5CsmToq9nAVgE4PkS25TkmnS2+wYAGy0apXJgYPu68rjXoJVf9ck6AH8dVZl8EMCBdmrPByRPb4/JkLwQrTj0Wv//q/A2EMA3ALxgZv/c47DKrmOS9mW6jq5GnTOMUn8CrU/YNwH8HsCG6PEzAKyPvj4LrSqKrQB2oJVq8aZ9dnyk/0W0eszO2hed+zQAvwDwUvTvqdHjowC+Hn19CYBt0TXcBuAzDto15ZoAuAfANdHXJwP4HoBdAP4bwFmOr9ug9t0bvd+2AngMwHsct+8hAHsBHIreg58BcDuA26PnCeArUfu3oU+VW0Xtu6Pj+j0F4BKX7Yva8FdopWeeA7Al+u9qX65jwvalvo5aWkFEJBC1TumIiEhyCvgiIoFQwBcRCYQCvohIIBTwRUQCoYAvIhIIBXwRkUD8P3fsG6if9C9DAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='gini',\n",
       "                       max_depth=None, max_features=None, max_leaf_nodes=None,\n",
       "                       min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "                       min_samples_leaf=1, min_samples_split=2,\n",
       "                       min_weight_fraction_leaf=0.0, presort='deprecated',\n",
       "                       random_state=None, splitter='best')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.tree import DecisionTreeClassifier\n",
    "dt_clf = DecisionTreeClassifier()       #不传参数，默认用基尼系数，会一直划分直至所有数据基尼系数都为0\n",
    "dt_clf.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_decision_boundary(model, axis):\n",
    "    \n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*100)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*100)).reshape(-1, 1),\n",
    "    )\n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "\n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "\n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#EF9A9A','#FFF59D','#90CAF9'])\n",
    "    \n",
    "    plt.contourf(x0, x1, zz, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xf95d8423c8>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3df4xd5X3n8ffXMwMzhsHGGNeDjXEo2MuvFTaIDTXNIm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ol5j1Pz3KUTeD4BfAU8Ez58DDASPz6dQ6fEysIdCCse7drqTldFnjrgAAAC0SURBVAhvULjaTqKdZwE/AX4e/D8veP5K4L7g8W8Bu4PjuRv4XIztm3F8gDuAG4PH3cCPgH3AvwLnJ/R3Wa+dfxH8Lb4M/BT4Dwm08WFgCBgL/jY/B9wC3BJ83yjcpOrN4H2uWsWXcDtvLTmWzwK/lUAbr6GQ/nkFeCn4t9a349lgO5s+nlq6QkREgJSljEREpH0UEEREBFBAEBGRgAKCiIgACggiIhJQQBAREUABQUREAv8fSdkcrBLX+YUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(dt_clf, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])            #过拟合"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xf9558caa88>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfI0lEQVR4nO3df5Ac5Z3f8fdXu2u0cIMWITitJX4YgxQw5KwfxdknLsX5RAqpEsjl5DLOH4cpXCriYOfiurpzSildijoq5lJFcge+XMkcd5BKYce6xBaxFIIsO77ogoPAYH7IyILYZqXFwihIC6zw/vjmj+1Zdmdndnqme7qf7v68qlSane2dfrZnp7/9fJ/v87S5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k2PYRpw2PAo84u7vmtkdzPRqPtbzlnUmhGMZx9PAJe7+lpltBb4OXJFHQ8zsl4C/Bn7X3U83frvJj+RyPNu0s+PjmWlA8OTLYODux6P/T5jZf2WmW59qQEihnZks17FYO83sZ2Y27O6jUXf2RIvXqB/PV8zsO8xcafQ6IMQ5PvVtRsysH1hG9umGtu109zfmfPll4J4M2tWpQiwfM/eE5u57zezPzGyFu2e6oJyZDTBzkv1P7v5fmmwSxPFs185ujmehUkZmdo6Z1eqPgb/PzD0ZQhPCch17gFujx7cCC3o2ZnaemZ0VPV4BbCKbZcnjHJ+57d8GHPBopCxDbdvZkDu+iZlcbmj2AL8TVcd8BDhVTyeGxMxW1seJzOxaZs5Pbyz+U6m3wYC/AA67+70tNsv9eMZpZ1fHM+vR8UVGzX+Lmcj7LvAz4LHo+fcDe6PHlzFT6fEs8AIzKZzg2unvVSIcYeZqO492ng98C/hR9P/y6PmNwAPR418DnouO53PA7Rm2b8HxAe4CbooeLwW+BhwF/g9wWU5/l+3a+W+iv8VngW8DfyeHNj4CjAIT0d/m7cAdwB3R942Zm1S9HL3PLav4cm7nnXOO5RPAr+XQxuuYSf/8AHgm+rc1tOMZs50dH08tXSEiIkDBUkYiItI7CggiIgIoIIiISEQBQUREAAUEERGJKCCIiAiggCAiIpH/D/HG6+0dAe/xAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf2 = DecisionTreeClassifier(max_depth=2)             #深度为2 ，没过拟合， 但可能欠拟合\n",
    "dt_clf2.fit(X, y)\n",
    "plot_decision_boundary(dt_clf2, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xf95bcd6d48>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfD0lEQVR4nO3df5Ac5Z3f8fdXu2u06FYSQnBaS/wwB1L4lSBQcfaJS1E+kUKqBOVycllOpQ5TuFTEwfbFlbrzlap0KapcMZcqEht8uZI5fJBzgWNdYotYCkGWHTu64PDb/NCBBbHNSmsLo0NaYIX3xzd/bM8yOzuz0zPd0/109+dVpdLsbO/0sz07/e3n+3yfp83dERERWZR3A0REJAwKCCIiAiggiIhIRAFBREQABQQREYkoIIiICJBSQDCz+8zsuJk93+L715vZSTN7Jvq3K439iohIevpTep2/BO4BHlhgmx+4+z9OaX8iIpKyVHoI7v594EQaryUiIvlIq4cQx4fM7FngGPBv3P2Fxg3MbAewA2DJGWdcc8mqVRk2T0TiemPw7LybIC289rdP/dLdz+nmZ7MKCE8BF7j7W2a2BfgmcEnjRu6+G9gNsP7CC/27O3dm1DwR6cT9V92cdxOkhT+49oyfdvuzmVQZufspd38rerwPGDCzlVnsW0RE4skkIJjZKjOz6PG10X7fyGLfIiISTyopIzN7ELgeWGlmI8CfAAMA7v7nwDbgX5rZJDAObHctsyoiEpRUAoK7f6zN9+9hpixVREQCpZnKIiICZFt2KgW1b2yQu08M8fPJPlb1T/GpFWNsGRrPu1kikjIFhBLpxYl739ggd7y+jNM+05kcneznjteXASgoiJSMUkYlUTtxj07249jsiXvf2GCi1737xNBsMKg57Yu4+8RQotcVkfAoIJREr07cP5/s6+h5ESkuBYSS6NWJe1X/VEfPi0hxKSCURK9O3J9aMcZim57z3GKb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/3bEtrxjNnOjo+nlq4QERGgYCkjERHpHQUEEREBFBBERCSigCAiIoACgoiIRBQQREQEUEAQEZHI/wdPXdvNTBMI6gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf3 = DecisionTreeClassifier(min_samples_split=10)          #越高越不会过拟合，但过高会欠拟合\n",
    "dt_clf3.fit(X, y)\n",
    "plot_decision_boundary(dt_clf3, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xf957d20e08>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfkUlEQVR4nO3df5Ac5X3n8fdXu0K7yIsECKK1hMAEpBPGqQipiG2RFOWIK0t1gfOFlOX8EUzZpeJ82OdyUolTqlKuqFBn5+pciU3uUjIhgasr40S5YHGWiiDLPhwl+PhhMAIdWFAG72qxMJSkBVZkf3zvj+0Rs6P50TPd0/109+dVpdLsTO/Msz0z/e3n+3yfp83dERERWZR3A0REJAwKCCIiAiggiIhIRAFBREQABQQREYkoIIiICJBSQDCze8zsuJkdbvH49WZ20syeiv7tSuN1RUQkPYMpPc9fA3cB97XZ5vvu/m9Sej0REUlZKj0Ed38EeCON5xIRkXyk1UOI40Nm9jR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a/ksv+7NDOrvdnpgHBky+Dgbsfi/4/bmZ/z3y3PtWAkEI7M1muo107zexnZjbq7hNRd/Z4i+eo7c+XzOx7zJ9p9DsgxNk/tW3GzGwQWEb26YaO7XT31+t+/Drw5Qza1a1CLB9Tf0Bz931m9t/MbIW7Z7qgnJktZv4g+z/d/X812SSI/dmpnb3sz0KljMxsqZmN1G4D/5r5azKEJoTlOvYCt0S3bwHO6tmY2flmtiS6vQLYTDbLksfZP/Xtvxk46NFIWYY6trMhd3wj87nc0OwFfieqjvkgcLKWTgyJma2sjROZ2bXMH59eb/9bqbfBgL8Ejrj7V1pslvv+jNPOnvZn1qPjbUbNP8Z85H0H+BnwUHT/e4F90e3Lma/0eBp4lvkUTnDt9HcrEV5g/mw7j3ZeCHwH+HH0/wXR/ZuAu6PbHwaeifbnM8CnMmzfWfsHuAO4Mbo9BPwtcBT4v8DlOX0uO7XzP0efxaeB7wL/Koc2fgOYAKajz+angNuA26LHjfmLVL0Yvc8tq/hybuftdfvyUeDDObTxOubTPz8Cnor+bQttf8ZsZ9f7U0tXiIgIULCUkYiI9I8CgoiIAAoIIiISUUAQERFAAUFERCIKCCIiAiggiIhI5P8DJXz11LTJA5AAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf4 = DecisionTreeClassifier(min_samples_leaf=6)          #对于叶子节点，有6个样本\n",
    "dt_clf4.fit(X, y)\n",
    "plot_decision_boundary(dt_clf4, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0xf957d9cc08>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfI0lEQVR4nO3df5Ac5Z3f8fdXu2u0cIMWITitJX4YgxQw5KwfxdknLsX5RAqpEsjl5DLOH4cpXCriYOfiurpzSildijoq5lJFcge+XMkcd5BKYce6xBaxFIIsO77ogoPAYH7IyILYZqXFwihIC6zw/vjmj+1Zdmdndnqme7qf7v68qlSane2dfrZnp7/9fJ/v87S5OyIiIkvyboCIiIRBAUFERAAFBBERiSggiIgIoIAgIiIRBQQREQFSCghm9qCZnTCz51t8/3ozO2Vmz0T/dqaxXxERSU9/Sq/zV8D9wMOLbPM37v4PUtqfiIikLJUegrt/FziZxmuJiEg+0uohxPFRM3sWOA78nru/0LiBmW0HtgOcc9ZZG65YuTLD5olIXG8Mnp93E6SFV3/49M/d/YJufjargPA0cIm7v2VmW4GvA1c0buTuu4BdAOsuvdS/vWNHRs0TkU489OFb826CtPC71571k25/NpMqI3c/7e5vRY/3AgNmtiKLfYuISDyZBAQzW2lmFj2+NtrvG1nsW0RE4kklZWRmjwDXAyvMbAT4Q2AAwN3/HNgG/FMzmwTGgVtcy6yKiAQllYDg7p9s8/37mSlLFRGRQGmmsoiIANmWnUpB7R0b5L6TNV6b7GNl/xSfXT7G1tp43s0SkZQpIJRIL07ce8cGuev1ZZzxmc7k6GQ/d72+DEBBQaRklDIqifqJe3SyH8dmT9x7xwYTve59J2uzwaDujC/hvpO1RK8rIuFRQCiJXp24X5vs6+h5ESkuBYSS6NWJe2X/VEfPi0hxKSCURK9O3J9dPsZSm5733FKb5rPLxxK9roiERwGhJHp14t5aG2fnBacY7p/EcIb7J9l5wSkNKIuUkKqMSqJ+gu5F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EQBQUREAAUEERGJKCCIiAiggCAiIpH/D/HG6+0dAe/xAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf5 = DecisionTreeClassifier(max_leaf_nodes=4)             #最多有4个叶子节点\n",
    "dt_clf5.fit(X, y)\n",
    "plot_decision_boundary(dt_clf5, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
